# -*- coding:utf8 -*-
# !/usr/bin/python
'''
author: lixinpan
createTime: 2021-07-23 14:57
update: lixinpan
updateTime: 2021-07-23 14:57
description: list排序问题
'''


def list_sort():
    # 在原对象上排序
    L1 = [1, 2, 4, 7, 3, 5]
    print(L1)
    L1.sort()
    print(L1)


def list_sorted():
    # 新建对象来排序
    L1 = ['a', 'b', 'CA', 'f', 'e', 'g']
    L2 = sorted(L1)
    L3 = sorted(L1, key=len)
    print(L1)
    print(L2)
    print(L3)


if __name__ == "__main__":
    # list_sort()
    list_sorted()
